#include "GameOperationView.h"


GameOperationView::GameOperationView(void)
	:_ui( nullptr )
	,_upBtn( nullptr)
	,_downBtn( nullptr )
{
}


GameOperationView::~GameOperationView(void)
{
}

bool GameOperationView::init()
{
	if ( !Layer::init() )
	{
		return false;
	}
	_ui = cocostudio::GUIReader::getInstance()->widgetFromJsonFile("ui/game_operation_1/game_operation_1.ExportJson"); 
	Size uiSize = _ui->getContentSize();
	Size size = ModuleMgr::inst()->getGameViewSize();
	Point pos;
	pos.x = 0;
	pos.y = (size.height - uiSize.height) / 2;
	_ui->setPosition( pos );
	addChild(_ui);  

	_upBtn = dynamic_cast<Button*>( _ui->getChildByTag( 2 ) );
	_downBtn = dynamic_cast<Button*>( _ui->getChildByTag( 3 ) );



	return true;
}

